package com.yoyo.yyadsdk.bean.dao;

import android.os.Parcel;
import android.os.Parcelable;

import com.yoyo.yyadsdk.config.PullFeature;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Unique;

@Entity
public class AdvScreenEntity implements Parcelable {

    /**
     * type : 广告展示形式(锁屏、弹屏、中间插屏、顶部banner、底部banner、右上小图标、右下小图标)
     * activities : 弹屏出现位置的activity名称集合 仅限弹屏广告
     * ruleId : 黑白名单规则id
     * frequency : 周期内的展示次数
     * interval : 两次展示间隔 单位：秒
     * status : 使用状态(启用/禁用)
     * duration : 展示时长(单位:s) 仅限banner广告
     * priority : 100 优先级
     */
    @Id(autoincrement = true)
    private Long _id;
    @Unique
    private int id;
    private int type;
    private String activities;
    private int ruleId;
    private int frequency;
    private long interval;
    private int status;
    private long duration;
    private int priority;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this._id);
        dest.writeInt(this.id);
        dest.writeInt(this.type);
        dest.writeString(this.activities);
        dest.writeInt(this.ruleId);
        dest.writeInt(this.frequency);
        dest.writeLong(this.interval);
        dest.writeInt(this.status);
        dest.writeLong(this.duration);
        dest.writeInt(this.priority);
    }

    public Long get_id() {
        return this._id;
    }

    public void set_id(Long _id) {
        this._id = _id;
    }

    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getType() {
        return this.type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getActivities() {
        return this.activities;
    }

    public void setActivities(String activities) {
        this.activities = activities;
    }

    public int getRuleId() {
        return this.ruleId;
    }

    public void setRuleId(int ruleId) {
        this.ruleId = ruleId;
    }

    public int getFrequency() {
        return this.frequency;
    }

    public void setFrequency(int frequency) {
        this.frequency = frequency;
    }

    public long getInterval() {
        return this.interval;
    }

    public void setInterval(long interval) {
        this.interval = interval;
    }

    public int getStatus() {
        return this.status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public long getDuration() {
        return this.duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public int getPriority() {
        return this.priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    public AdvScreenEntity() {
    }

    protected AdvScreenEntity(Parcel in) {
        this._id = (Long) in.readValue(Long.class.getClassLoader());
        this.id = in.readInt();
        this.type = in.readInt();
        this.activities = in.readString();
        this.ruleId = in.readInt();
        this.frequency = in.readInt();
        this.interval = in.readLong();
        this.status = in.readInt();
        this.duration = in.readLong();
        this.priority = in.readInt();
    }

    @Generated(hash = 1855432108)
    public AdvScreenEntity(Long _id, int id, int type, String activities, int ruleId, int frequency,
            long interval, int status, long duration, int priority) {
        this._id = _id;
        this.id = id;
        this.type = type;
        this.activities = activities;
        this.ruleId = ruleId;
        this.frequency = frequency;
        this.interval = interval;
        this.status = status;
        this.duration = duration;
        this.priority = priority;
    }

    public static final Parcelable.Creator<AdvScreenEntity> CREATOR = new Parcelable.Creator<AdvScreenEntity>() {
        @Override
        public AdvScreenEntity createFromParcel(Parcel source) {
            return new AdvScreenEntity(source);
        }

        @Override
        public AdvScreenEntity[] newArray(int size) {
            return new AdvScreenEntity[size];
        }
    };
}
